import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class smallRace extends JFrame {

	public java.awt.Container cp = getContentPane();
	public static JPanel race_Panel;
	public static JPanel horseQueue, winnerPanel;
	public JLabel hQueue, user, won;
	private int maxPlayers, x, y;

	@SuppressWarnings("unused")
	private String imageLocation;

	/**
	 * Prevents warning message
	 */
	private static final long serialVersionUID = 1L;

	public static void main(String[] args) throws Exception {

		new smallRace().setVisible(true);
	}

	/**
	 * Constructor builds and brings in panels to the JFrame
	 * 
	 * @throws Exception
	 */
	@SuppressWarnings("static-access")
	public smallRace() throws Exception {

		// Initialize variables
		this.maxPlayers = 6;
		this.imageLocation = "";
		this.x = 625;
		this.y = 660;

		// Create JFrame
		this.setExtendedState(this.MAXIMIZED_BOTH);
		this.setUndecorated(true);
		this.setLocation(0, 0);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setLayout(null);

		// Create Panel_1
		race_Panel = new RacePanel(6, "imgFiles/horse");

		// Create and/or add Panels for images and queues
		cp.add(race_Panel);

		for (int i = 0; i < this.maxPlayers; i++, this.y += 33) {
			cp.add(((RacePanel) race_Panel).createUserPanels(i, this.x, this.y));
			cp.add(((RacePanel) race_Panel).createUserPositions(i, this.x,
					this.y));
			if (i == 2)
				y -= 99;
		}
		cp.add(((RacePanel) race_Panel).createTimerPanel2());
		cp.add(((RacePanel) race_Panel).createTimerTitle2());
		cp.add(((RacePanel) race_Panel).createTimerPanel());
		cp.add(((RacePanel) race_Panel).createTimerTitle());
		cp.add(((RacePanel) race_Panel).createWinnerPanel());
		cp.add(((RacePanel) race_Panel).createWinnerInfoPanel());
		cp.add(((RacePanel) race_Panel).createTrophyPanel());
		cp.add(((RacePanel) race_Panel).createAddingUsersPanel());
		cp.add(((RacePanel) race_Panel).createUserPanelBackground());

	}
}
